import unittest
from api.base import Base
from HTMLTestRunner import HTMLTestRunner

test_report = 'test_report.html'


if __name__ == '__main__':

    # 进行登录
    base = Base()
    base.login()


    # 创建一个套件
    suite = unittest.TestLoader().discover('cases',pattern='test*.py')

    # 运行套件
    with open(test_report,'wb') as f:

        runner = HTMLTestRunner(f,title='wshop测试报告',description='简化版的测试框架')
        runner.run(suite)